<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<a href="javascript:void(0);" onclick="$('#win_create_quotation').dialog('close');" class="window-close"></a>
 <dl class="pc_m" style="width: 500px;">
 	<input type="hidden" id="order_days" value="${days}" />
 	<div class="form" style="width: 500px;">
 		<p>
		 	<span>
		 	寄养日期:
		 	<fmt:formatDate value="${order.orderStartDate}" type="date" pattern="yyyy/MM/dd"/>
		 	 - 
		 	<fmt:formatDate value="${order.orderEndDate}" type="date" pattern="yyyy/MM/dd"/>
		 	(共计${days}天)
		 	</span>
	 	</p>
 	</div>
    <div class="form" style="width: 500px;">
    	<p style="width: 400px;height: 20px;">
    		评价等级:<div id="ratyDiv" style="width: 150px;margin-top: 10px" data-score="3"></div>
    	</p>
    	<p style="width: 500px;height: 150px;">
    		评价内容:<textarea  style="width: 400px;height: 100px;" name="appraise"></textarea>
    	</p>
    </div>
    <div class="btn" style="width: 500px;"><a href="javascript:submitAppraise()">提交</a></div>
</dl>


<script type="text/javascript">
var submitAppraise = function(){
	var submitData = {"order.id":"${param['id']}", "order.appraise":$("[name='appraise']").val(), "order.evaluate":$('#ratyDiv').attr("data-score")};
	$.post("${ctx}/order/saveAppraise.do", submitData, function(res){
		if(res.code == 1) {
			msg.msg("评价成功。");
			$('#win_create_quotation').dialog('close');
			tools.href();
		} else {
			msg.error(res.msg);
		}
	}, "json");
}

$(function(){
	$('#ratyDiv').raty({
		 path: '${cas}/js/jquery/raty/img',
		 width:200,
		 score:3,
		 click: function(s) {
			 $('#ratyDiv').attr("data-score", s);
		 }
	});
});
</script>
</body>
</html>